﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using XRpgLibrary.TileEngine;

namespace XRpgLibrary.ExtensionMethods
{
    public static class TileMatrixExtension
    {
        public static bool Contains(this Tile[,] tiles, Tile targetTile)
        {
            for (int y = 0, ycnt = tiles.GetLength(0); y < ycnt; y++)
                for (int x = 0, xcnt = tiles.GetLength(1); x < xcnt; x++)
                    if (tiles[y, x] == targetTile)
                        return true;

            return false;
        }
    }
}
